import type { postOrPutType } from "@/constants";
import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
/* 商学院视频 地址 */
const url = "/back/business-school-video";
/* 商学院视频数据：获取 商学院视频信息 */
export const getBusinessSchoolVideoInfo = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 获取 商学院视频详情信息 */
export const getBusinessSchoolVideoByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 新增，修改商学院视频信息 */
export const commonBusinessSchoolVideoInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 删除 商学院视频信息 */
export const deleteBusinessSchoolVideoInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
